package Question2;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import java.util.Vector;

/**
 * Created by lenovo on 2017/3/6.
 */
public class Main {

    public  static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        String str = scanner.nextLine();
        List<String> list = new ArrayList<>();
        String number = "0123456789";

        char[] ch = str.toCharArray();
        String element = "" + ch[0];
        for(int i=1;i<ch.length;i++){
            if((number.indexOf(ch[i-1])==-1&&number.indexOf(ch[i])!=-1)||(number.indexOf(ch[i-1])!=-1&&number.indexOf(ch[i])==-1)){
                if(!element.equals("")){
                    element+="_"+ch[i];
                }else{
                    element+=ch[i];
                }
            }else if(ch[i]!=' '){
                element+=ch[i];
            }else if(ch[i] == ' '&&ch[i-1]!=' '){
                list.add(element);
                element = "";
            }
        }

        //最后一个单词输入
        if(!element.equals("")){
            list.add(element);
        }

        str = "";
        for(int i=0;i<list.size();i++){
            //头部变成大写
            String elements = list.get(i);
            str+=elements.substring(0,1).toUpperCase()+elements.substring(1,elements.length())+" ";
        }

        System.out.println(str.trim());
    }
}
